home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / STRINGS / PARSING.PAS < prev    next >
Pascal/Delphi Source File  |  1996-07-21  |  905b  |  27 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; string parsing
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBTXT;
  10.  
  11. var MyParser : ParserObjectType; Index : byte; MyString : string;
  12.  
  13.  
  14. begin
  15.      MyString := 'THIS IS A PARSING DEMONSTRATION!WITH TWO TOKENS.';
  16.      WriteLn;
  17.      with MyParser do begin
  18.           { Use MyString and separate tokens with spaces }
  19.           Initialize (@MyString, [#32, '!']);
  20.           { Display all tokens in their actual order }
  21.           for Index := 1 to Tokens do begin
  22.               Write (Token(Index));
  23.               if Index <> Tokens then Write (' -- ');
  24.           end;
  25.           Intercept;
  26.      end;
  27. end.